const path = require("path"); //引入path模块
function resolve(dir) {
  return path.join(__dirname, dir); //path.join(__dirname)设置绝对路径
}

module.exports = {
    // publicPath:'./',      //反向代理js css 丢失
    devServer:{
            open:true,
        },
        pages: {
            index: {
                entry: './demo/main.js', //page 的入口
                template: './public/index.html' //模板来源
            }
        },
        chainWebpack: (config) => {
            config.resolve.alias
                .set('@', resolve('src'))
                .set('components', resolve('src/components'))
                .set('demo', resolve('./demo'))
                .set('^', resolve('src/assets/css'))
                .set('img', resolve('src/assets/img'))
                .set('util', resolve('util'))
                //set第一个参数：设置的别名，第二个参数：设置的路径
        },
    
}
